TreeMap

A key→value mapping where the keys are guaranteed to be sorted.

Disabled Default Constructor

A disabled default is present on this object. To use it, use one of the other constructors or a factory function.

Constructors

this
this(Allocator allocator)

Use the given allocator for allocations.

Postblit

Copying this object is disabled.

A postblit is present on this object, but not explicitly documented in the source.

Members

Aliases

opSlice
alias opSlice = byValue

Functions

byKey
auto byKey()
byKeyValue
auto byKeyValue()
byValue
auto byValue()
containsKey
bool containsKey(const K key)
empty
bool empty()
get
auto get(const K key, lazy V defaultValue)
getOrAdd
auto getOrAdd(const K key, lazy V value)

If the given key does not exist in the TreeMap, adds it with the value defaultValue.

insert
void insert(const K key, V value)

Inserts or overwrites the given key-value pair.

keys
auto keys()
length
size_t length()
opIndex
auto opIndex(const K key)

Supports treeMapkey syntax.

opIndexAssign
void opIndexAssign(V value, const K key)

Supports treeMapkey = value; syntax.

remove
bool remove(const K key)

Removes the key→value mapping for the given key.

values
auto values()

Meta